import { createApp } from 'vue'
// import './style.css'
import './assets/less/index.less'

import App from './App.vue'
import router from './router/index.js'

// 注册icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// pinia仓库
import {createPinia} from 'pinia'
const pinia= createPinia()
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
pinia.use(piniaPluginPersistedstate)
// 引入mock
import './api/mock.js'
// 全局引入封装的请求
import api from './api/api.js'

const app=createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 定义全局属性对象
app.config.globalProperties.$api=api

app.use(pinia)
app.use(router)
app.mount('#app')
